﻿using FluentValidation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LettuceEncrypt.Extensions.AliDns;

public class AlibabaCloudOptionsValidator : AbstractValidator<AlibabaCloudOptions>
{
    public AlibabaCloudOptionsValidator()
    {
        RuleFor(x => x)
            .NotNull()
            .ChildRules(x =>
            {
                RuleFor(x => x.AccessKeyId)
                    .NotNull()
                    .NotEmpty();

                RuleFor(x => x.AccessKeySecret)
                    .NotNull()
                    .NotEmpty();

                RuleFor(x => x.Address)
                    .NotNull()
                    .NotEmpty();
            });
    }   
}
